package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Departments generated by hbm2java
 */
@Entity
@Table(name="departments"
    ,catalog="madr_bd10"
    , uniqueConstraints = @UniqueConstraint(columnNames="code_dep") 
)
public class Departments  implements java.io.Serializable {


     private Integer idDep;
     private String codeDep;
     private String nameDep;
     private Set municipalitieses = new HashSet(0);

    public Departments() {
    }

	
    public Departments(String codeDep, String nameDep) {
        this.codeDep = codeDep;
        this.nameDep = nameDep;
    }
    public Departments(String codeDep, String nameDep, Set municipalitieses) {
       this.codeDep = codeDep;
       this.nameDep = nameDep;
       this.municipalitieses = municipalitieses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_dep", unique=true, nullable=false)
    public Integer getIdDep() {
        return this.idDep;
    }
    
    public void setIdDep(Integer idDep) {
        this.idDep = idDep;
    }
    
    @Column(name="code_dep", unique=true, nullable=false, length=3)
    public String getCodeDep() {
        return this.codeDep;
    }
    
    public void setCodeDep(String codeDep) {
        this.codeDep = codeDep;
    }
    
    @Column(name="name_dep", nullable=false, length=100)
    public String getNameDep() {
        return this.nameDep;
    }
    
    public void setNameDep(String nameDep) {
        this.nameDep = nameDep;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="departments")
    public Set getMunicipalitieses() {
        return this.municipalitieses;
    }
    
    public void setMunicipalitieses(Set municipalitieses) {
        this.municipalitieses = municipalitieses;
    }




}


